<template>
    <!--招采管理-班组招采列表-应标结果弹窗-->
    <j-modal
      :title="title"
      :width="width"
      :visible="visible"
      switchFullscreen
      @ok="handleOk"

      :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
      @cancel="handleCancel"
      okText="预览会签表"
      cancelText="关闭">
      <wt-team-result-form  @ok2="ok3" v-if="id !== ''" ref="realForm" @updateBiddingSuccess="updateBiddingSuccess" @ok="submitCallback" :disabled="disableSubmit" :id="id" :pageType="pageType"></wt-team-result-form>

    </j-modal>
  </template>

  <script>

    import WtTeamResultForm from './WtTeamResultForm'

    export default {
      name: 'WtTeamResultModal',
      components: {
        WtTeamResultForm
      },
      data () {
        return {
          showKey:"wt-public-form",
          title:'发标',
          id: '',

          width:1100,
          visible: false,
          disableSubmit: false,
					pageType:'',
        }
      },
      methods: {
        add () {
          this.visible=true
          this.$nextTick(()=>{
            this.$refs.realForm.add();
          })
        },
        edit (record,type) {
          this.visible=true
          var _this = this
          _this.id  = record.id
			this.pageType = type;
          this.$nextTick(()=>{
          // console.log('编辑2：', record.id)
          //   this.$refs.realForm.edit(record);
          })
        },
        close () {
          this.$emit('close');
          this.visible = false;
        },
        handleOk (record) {
          // console.log('确认', this.id)
          this.$emit('list', this.id)
          this.$refs.realForm.updateBidding(this.id);
        },
        updateBiddingSuccess(){
          this.$emit('updateBiddingOk', this.id);
        },
        submitCallback(){
          this.$emit('ok');
          this.visible = false;
        },
        ok3(){
          this.$emit('ok4');
          this.close()
          this.visible = false;
        },
        handleCancel () {
          this.close()
        }
      }
    }
  </script>